package java_thinking.unit_12;

/**
 * @Description : 12.6
 * @author: cww
 * @DateTime: 2019/3/21 8:33
 */

public class WhoCalled {
    static void f() {
        try {
            throw new Exception();
        } catch (Exception e) {
            for (StackTraceElement ste:e.getStackTrace()){
                System.out.println(ste.getMethodName());
                System.out.println(ste.getClassName());
            }
        }
    }
    static void g() {
        f();
    }
    static void h() {
        g();
    }

    public static void main(String[] args) {
        f();
        System.out.println("----------------");
        g();
        System.out.println("----------------");
        h();
        System.out.println("end");
    }
}
